<script setup>
    import {ref,reactive} from "vue";
    let count = ref(1);
    let obj = reactive({
      num: 1
    })
    let user = {
      username: "张三",
      age: 18
    }
    function getData(){
      count.value++;
    }
    function changeData(){
      obj.num++;
    }
    function getUser(){
      console.log(user);
      user.age++;
    }
</script>

<template>
  <button @click="getData">点我 {{count}}</button>
  <button @click="changeData">获取数据 reactive: {{obj.num}}</button>
  <button @click="getUser">获取数据 reactive: {{user.username}} - {{user.age}}</button>
</template>

<style scoped>

</style>